<?php


namespace api\user\validate;


use think\Validate;

class UserValidate extends Validate
{

    protected $rule=[
        'mobile'=>'require|mobile',
        'nickname'=>'require',
        'code'=>'max:4|require',
    ];

    protected $message=[
        'image.require' => '头像不能为空',
        'name.require' => '昵称不能为空',
        'mobile.require' => '手机号不能为空',
        'mobile.mobile' => '手机号格式不符',
        'code.max'=>'验证码长度不对',
        'code.require'=>'验证码必填'
    ];

    protected $scene=[
        'register'=>['mobile','code'],
        'login' => ['mobile','code'],
        'edit' => ['image','name','mobile']
    ];
}
